<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .card{
            position: relative;
            width: 400px;
            height: 200px;
            background-color: orange;
            overflow: hidden;
        }
        .card .tip{
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 50px;
            background-color: rgba(0,0,0,.5);
                /* 自身高度的100%  */
            /* transform: translateY(100%); */
            transform: translateX(100%);
            transition: .8s;
        }
        .card:hover .tip{
            /* transform: translateY(0); */
            transform: translateX(0);
        }



        /* 块级元素 定位水平垂直居中  */
        /* 宽高已知  */
        /* 1. left:50%; top:50%; margin-left/margin-top  */
        /* 2. left/top/bottom/right: 0 ;  margin:auto;  */


        /* 宽高未知  */

        .box{
            position: absolute;
            left: 50%;
            top: 50%;

            /* translate 里边的 百分数 是 以自身作为参照物的   */
            transform: translate(-50%,-50%);
        }


        /* display:none  和  display:block  不适宜用过渡 transition  */

        .card1{
            position: relative;
            width: 400px;
            height: 200px;
            background-color: orange;
            overflow: hidden;
        }
        .card1 .tip1{
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 50px;
            background-color: rgba(0,0,0,.5);
            transition: .8s;
            /* display: none; */
            opacity: 0;
        }
        .card1:hover .tip1{
            /* display: block; */
            opacity:1;
            transform: translateY(-100px);
        }
    </style>
</head>
<body>
    <div class="card">
        <div class="tip">
            提示信息
        </div>
    </div>


    <div class="card1">
        <div class="tip1">
            提示信息
        </div>
    </div>
</body>
</html>